<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="/oa/Public/js/jquery.js"></script>
<script type="text/javascript" src="/oa/Public/js/common.js"></script>
<link rel="stylesheet" type="text/css" href="/oa/Public/css/global.css" />
<link rel="stylesheet" type="text/css" href="/oa/Public/css/form.css" />
<script type="text/javascript" src="/oa/Public/js/jquery.form.js"></script>
</head>
<body>
<div class="search"><b><?php echo ($foldername); ?></b>
<input type="button" value="上传文件" class="button" onclick="upload(<?php echo ($id); ?>)" />
<input type="button" value="返回列表" class="button" onclick="back()" /></div>
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
        <tr>
            <th style="min-width: 30px;"><input type="checkbox" name="checkid" onclick="if(this.checked==true) { checkAll('key[]'); } else { clearAll('key[]'); }" ></th>
            <th width="70%">文件名</th>
            <th width="15%">上传时间</th>
            <th width="13%">操作</th>
        </tr>
    </thead>
 
    <tbody>
   	  <?php if(is_array($data_list)): $i = 0; $__LIST__ = $data_list;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><input type="checkbox" name="key[]" value="<?php echo ($vo["id"]); ?>"></td>
            <td><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):"---"); ?></td>
            <td><?php echo ((isset($vo["upload_time"]) && ($vo["upload_time"] !== ""))?($vo["upload_time"]):"---"); ?></td>
            <td>
            	<a href="/oa/index.php/Database/download?id=<?php echo ($vo["id"]); ?>&type=<?php echo ($type); ?>" target="_black" >下载</a>
            	 | <a href="javascript:void(0)" onclick="del(<?php echo ($vo["id"]); ?>)">删除</a>
            </td>
        </tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
    </tbody>
</table>
</div>
</body>
<script type="text/javascript">
function upload(id){
	window.location="/oa/index.php/Database/upload?id="+id+'&type=<?php echo ($type); ?>';
}
function del(id){
	if(confirm("确定删除该文件？删除之后不可恢复，请谨慎操作！")){
		$.get("/oa/index.php/Database/delete?id="+id+"&type=<?php echo ($type); ?>",function(result){
			alert(result);
			location.reload();
		});
	}else{
		return false;
	}
}
</script>
</html>